﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BW.WMS.Migrations
{
    /// <inheritdoc />
    public partial class new6 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            

            migrationBuilder.DropPrimaryKey(
                name: "PK_ApplatestAllotSUBModel",
                table: "ApplatestAllotSUBModel");

            migrationBuilder.DropPrimaryKey(
                name: "PK_ApplatestAllotModel",
                table: "ApplatestAllotModel");

            migrationBuilder.RenameTable(
                name: "ApplatestAllotSUBModel",
                newName: "latestAllotSUBModels");

            migrationBuilder.RenameTable(
                name: "ApplatestAllotModel",
                newName: "latestAllotModels");

            migrationBuilder.AddColumn<string>(
                name: "Librarylocationid",
                table: "AppMe_StHd",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Depid",
                table: "AppDm_Warehouser",
                type: "longtext",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddPrimaryKey(
                name: "PK_latestAllotSUBModels",
                table: "latestAllotSUBModels",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_latestAllotModels",
                table: "latestAllotModels",
                column: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_latestAllotSUBModels",
                table: "latestAllotSUBModels");

            migrationBuilder.DropPrimaryKey(
                name: "PK_latestAllotModels",
                table: "latestAllotModels");

            migrationBuilder.DropColumn(
                name: "Librarylocationid",
                table: "AppMe_StHd");

            migrationBuilder.RenameTable(
                name: "latestAllotSUBModels",
                newName: "ApplatestAllotSUBModel");

            migrationBuilder.RenameTable(
                name: "latestAllotModels",
                newName: "ApplatestAllotModel");

            migrationBuilder.AlterColumn<int>(
                name: "Depid",
                table: "AppDm_Warehouser",
                type: "int",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "longtext")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddPrimaryKey(
                name: "PK_ApplatestAllotSUBModel",
                table: "ApplatestAllotSUBModel",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_ApplatestAllotModel",
                table: "ApplatestAllotModel",
                column: "Id");

            migrationBuilder.CreateTable(
                name: "AppDm_Departments",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    ExtraProperties = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    departmentCode = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    departmentDesc = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    departmentName = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppDm_Departments", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }
    }
}
